<!DOCTYPE html>
<html>
<head>
    <script src="https://code.jquery.com/jquery-1.12.4.min.js" type="text/javascript"></script>
    <script src="https://code.jquery.com/ui/1.10.3/jquery-ui.min.js" type="text/javascript"></script>

    <link href="https://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" rel="stylesheet" />
</head>
<body>
    <div class="container">
        <h1>ShowModalDialog Fix - Main Page</h1>

        <a id="lnkPopup1" href="#">Show Popup1</a>

        <link href="Scripts/iFramePopup.css" rel="stylesheet" />
    </div>
    <script src="Scripts/iFramePopup.js"></script>
    <script>
        $(function () {
            $(function () {

                function fn_Success() { alert('Success - Popup 1') }
                function fn_Close() { alert('Closed - Popup 1') }

                var sender = $("#lnkPopup1");

                sender.click(function () {
                    var options = {
                        width: 800,
                        height: 600,
                        onsuccess: fn_Success,
                        oncancel: fn_Close,
                        sender: sender,
                        url: 'PopUp1.html?title=Popup 1',
                        title: null
                    };

                    $.iFramePopup(options);
                });
            });
        });
    </script>
</body>
</html>